#include <iostream>
#include <iomanip>
#include <windowscontracts.h>
#include "ChaosSoup-1.h"

int main() noexcept {
#ifdef _WIN32
    SetConsoleOutputCP(65001);
    SetConsoleCP(65001);
#endif
    std::ios::sync_with_stdio(false);
    std::cout << std::hex << std::setfill('0');

    std::string input;

    while (std::getline(std::cin, input) && !input.empty()) {
        std::cout << "Hash result: ";
        for (const auto& v : ChaosSoup::hash({input.begin(), input.end()})) {
            std::cout << std::setw(2) << static_cast<unsigned>(v);
        }
        input.clear();
        std::cout << std::endl;
    }

    return 0;
}